Telegram Group & Telegram Channel
Semolina Code (Python / TypeScript)
Конкурс Сейчас один знакомый написал, что в web3 софтах на JS/TS нельзя добавить прокси к rpc вызовам Пробовал на либах web3.js, ethers.js, viem Мб тут есть сильные JSеры, которые смогут показать пример как добавить http прокси в одну из библиотек (web3.js…
Конкурс закрывается

Победитель @fraggdiller 🏆
https://www.oklink.com/ru/arbitrum/tx/0x6d0e1196aef639b2b2f6aa75bab962ab9fe626bfee233e15d0ce61ee129f2940

Получилось прикрутить прокси к ethers.js:

import { HttpsProxyAgent } from 'https-proxy-agent';
import { ethers } from 'ethers';

(async () => {
const proxy = '';
const rpc = '';

let fetchRequest: ethers.FetchRequest;
const agent = new HttpsProxyAgent(proxy);

fetchRequest = new ethers.FetchRequest(rpc);
// fetchRequest.setHeader('user-agent', userAgent);
fetchRequest.getUrlFunc = ethers.FetchRequest.createGetUrlFunc({ agent: agent });

let provider = new ethers.JsonRpcProvider(fetchRequest);
console.log(await provider.getBlockNumber());
})();


SemolinaCode | Chat | YouTube | Arbuzers | HowToCode | Prop



tg-me.com/semolina_code_python/87
Create:
Last Update:

Конкурс закрывается

Победитель @fraggdiller 🏆
https://www.oklink.com/ru/arbitrum/tx/0x6d0e1196aef639b2b2f6aa75bab962ab9fe626bfee233e15d0ce61ee129f2940

Получилось прикрутить прокси к ethers.js:


import { HttpsProxyAgent } from 'https-proxy-agent';
import { ethers } from 'ethers';

(async () => {
const proxy = '';
const rpc = '';

let fetchRequest: ethers.FetchRequest;
const agent = new HttpsProxyAgent(proxy);

fetchRequest = new ethers.FetchRequest(rpc);
// fetchRequest.setHeader('user-agent', userAgent);
fetchRequest.getUrlFunc = ethers.FetchRequest.createGetUrlFunc({ agent: agent });

let provider = new ethers.JsonRpcProvider(fetchRequest);
console.log(await provider.getBlockNumber());
})();


SemolinaCode | Chat | YouTube | Arbuzers | HowToCode | Prop

BY Semolina Code (Python / TypeScript)


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/semolina_code_python/87

View MORE
Open in Telegram


Semolina Code Python Telegram | DID YOU KNOW?

Date: |

Telegram is riding high, adding tens of million of users this year. Now the bill is coming due.Telegram is one of the few significant social-media challengers to Facebook Inc., FB -1.90% on a trajectory toward one billion users active each month by the end of 2022, up from roughly 550 million today.

If riding a bucking bronco is your idea of fun, you’re going to love what the stock market has in store. Consider this past week’s ride a preview.The week’s action didn’t look like much, if you didn’t know better. The Dow Jones Industrial Average rose 213.12 points or 0.6%, while the S&P 500 advanced 0.5%, and the Nasdaq Composite ended little changed.

Semolina Code Python from jp


Telegram Semolina Code (Python / TypeScript)
FROM USA